<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <title>jQuery UI Autocomplete - Default functionality</title>
    <script src="../../js/auto_compelete/jquery.min.js"></script>

    <script type="text/javascript">
        $(function() {

            function parseURL(url){
                var url = url.split("?")[1];
                var para = url.split("&");
                var res = {};
                var arr = [];
                for(var i=0;i<para.length;i++){
                    arr = para[i].split("=");
                    res[arr[0]] = arr[1];
                }
                return res;
            }

            function getData(){
                var param = parseURL(window.location.href);
                $.ajax({
                    type:"GET",
                    dataType: "json",
                    async: true,
                    url:"/my-test-web/person/personDetail.json?id="+param.id,
                    success:function(data){
                        if (data != undefined){
                            $("#person-detail").text(data.name+"|"+data.age+"|"+data.address);
                        }
                    }
                });
            }
            getData();
        });


    </script>
</head>
<body>
<h4>人员详情</h4>
<span id="person-detail"></span>
</body>
</html>
